class AnvilRenderer : public IBlockRenderer
{
public:
	ITexture *Texture;

	AnvilRenderer(ITexture *texture) :
		Texture(texture)
	{
	}

	int GetTypeData(const int &data) { return data; }

	void Render(Schematic *schematic, RendererBase *renderer, const Block &block, const Point3i &position)
	{
		if ((block.Data & 0x01) != 0)
		{
			renderer->Translate(8, 8, 8);
			renderer->Rotate(90, 0, 1, 0);
			renderer->Translate(-8, -8, -8);
		}

		renderer->Draw(Box(Texture, Point3i(12, 4, 12), Point3i(2, 12, 2)).SetAll(Point2i(7 * 16, 13 * 16)));
		renderer->Draw(Box(Texture, Point3i(8, 1, 10), Point3i(4, 11, 3)).SetAll(Point2i(7 * 16, 13 * 16)));
		renderer->Draw(Box(Texture, Point3i(4, 5, 8), Point3i(6, 6, 4)).SetAll(Point2i(7 * 16, 13 * 16)));

		Point2i top((7 * 16) + 3, 14 * 16);

		if ((block.Data & 0x04) != 0)
			top = Point2i((8 * 16) + 3, 13 * 16);
		else if ((block.Data & 0x08) != 0)
			top = Point2i((8 * 16) + 3, 14 * 16);

		renderer->Draw(Box(Texture, Point3i(10, 6, 16), Point3i(3, 0, 0)).SetAll(Point2i(7 * 16, 13 * 16)).SetTop(top));
	}
};